package com.itheima.web.request;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 1.继承HttpServlet
 * 2.重写doXXX
 * 3.编写访问路径
 */
@WebServlet("/req6")
public class RequestDemo6 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("RequestDemo6......");
        // 读取上一servlet给我的数据
        // 从req取数据
        String name = (String)req.getAttribute("name");
        resp.getWriter().write("RequestDemo6....   check:"+name);
    }
}
